import java.io.*;
import java.util.*;
public class FileSaver {

private static ObjectOutputStream oout = null;
private static ObjectInputStream oin = null;
 
  public static void write(String filename, ArrayList<Object> arraylist) throws IOException {    
      oout = new ObjectOutputStream(new FileOutputStream(filename));    
      oout.writeObject(arraylist);
  }
public static ArrayList<Object> read(String filename) throws IOException, ClassNotFoundException {    
      oin = new ObjectInputStream(new FileInputStream(filename));
      return (ArrayList<Object>) oin.readObject();
  }
 
}
